export const getCookieFromStorage = (cookieName) => {
  let allCookie = document.cookie
  if (allCookie.length > 0) {
    let cookieArr = allCookie.split(';')
    for (let i = 0; i < cookieArr.length; i++) {
      let index = cookieArr[i].indexOf(cookieName)
      if (index > -1) {
        return {
          cookieName: cookieArr[i].substr(0, cookieArr[i].indexOf('=')),
          cookieValue: cookieArr[i].substr(cookieArr[i].indexOf('=') + 1, cookieArr[i].length)
        }
      }
    }
  }
  return {}
}
